﻿<%@ Page Title="User Profile" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="UserProfile.aspx.vb" Inherits="WSAD_Assignment.UserProfile" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <h3 class="form-signup-heading">User Profile</h3>

    <asp:LinkButton ID="btnEditProfile" 
            runat="server"
            CssClass="btn btn-primary cancel"  
            CausesValidation="false"      
            PostBackUrl="~/EditProfile.aspx">
            <i aria-hidden="true" class="glyphicon glyphicon-pencil"></i> Edit Profile
    </asp:LinkButton>
    <br /><br />
    <asp:DetailsView ID="dvUserProfile" runat="server" AutoGenerateRows="False" DataSourceID="UserListDataSource" GridLines="None"
        CssClass="table table-hover table-striped table-bordered table-condensed">
        <Fields>
            <asp:ImageField DataImageUrlField="Picture" HeaderText="Profile Picture">
                <ControlStyle Height="100px" Width="100px" />
            </asp:ImageField>
            <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" />
            <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" />
            <asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" />
            <asp:BoundField DataField="DateOfBirth" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Date of Birth" SortExpression="DateOfBirth" />
            <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
            <asp:BoundField DataField="CountryName" HeaderText="Country" SortExpression="CountryName" />
            <asp:BoundField DataField="EmailAddress" HeaderText="Email Address" SortExpression="EmailAddress" />
            <asp:BoundField DataField="ClubName" HeaderText="Favourite Club" SortExpression="ClubName" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="UserListDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ClubsConnectionString %>" ProviderName="<%$ ConnectionStrings:ClubsConnectionString.ProviderName %>" SelectCommand="SELECT [ID], [FirstName], [LastName], [Username], [DateOfBirth], [Address], [CountryName], [EmailAddress], [Picture], [ClubName] FROM [UserList] WHERE ([Username] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Username" QueryStringField="Username" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
</p>

</asp:Content>
